clear all;
close all;

% A = [1 2 3;4 5 6;7 8 9];
% b = [1;1;1];
% % A*b
% v = h(A' * b)
% size(v)
    
x0 = ones(18, 1);
[t,x] = ode45('plant', [0 20], x0);

x1 = x(:, 1);
x2 = x(:, 2);
x3 = x(:, 3);

x1_hat = x(:, 4);
x2_hat = x(:, 5);
x3_hat = x(:, 6);

% 绘制结果
figure(1);
plot(t, x1, 'b', t, x1_hat, 'r--', 'linewidth', 2);
xlabel('Time/s');ylabel('x');
legend('x1','x1_(hat)');

figure(2);
plot(t, x3, 'b', t, x3_hat, 'r--', 'linewidth', 2);
xlabel('Time/s');ylabel('phi');
legend('x3','x3_(hat)');

figure(3);
plot(t, x2, 'b', t, -x2_hat, 'r--', 'linewidth', 2);
xlabel('Time/s');ylabel('phi');
legend('x2','x2_(hat)');